package com.kodgem.smsmail;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        //startActivity(new Intent(MainActivity.this,MailRead.class));
        Toast.makeText(getApplicationContext(), ""+MailKontrol.readMail(), 5000).show();
        Button btn =(Button) findViewById(R.id.button1);
        btn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
				   startActivity(new Intent(MainActivity.this,Mail.class));
			}
		});
        
        startService(new Intent(this, SmsService.class));
     
        MailKontrol mk= new MailKontrol();
       // Toast.makeText(getApplicationContext(), ""+mk.mailOku(), 5000).show();
        
        //startActivity(new Intent(MainActivity.this,MailRead.class));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
}
